home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / ASIN.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  434 b   |  17 lines

  1. /* asin.c, FUNCTION FROM PAGE 197 OF TURBOC BIBLE */
  2. #include <stdio.h>
  3. #include <stdlib.h>                    /* errno is defined here */
  4. #include <math.h>
  5. #define R_TO_D 57.29578                /* radians to degrees */
  6. main()
  7. {
  8.     double value, result;
  9.     for(value = -1.0; value <= 1.0; value += 0.2)
  10.     {
  11.     result = asin(value) * R_TO_D;
  12.     if(errno != EDOM)
  13.     {
  14.         printf("arc sine (%f) = %f deg.\n",value, result);
  15.     }
  16.     }
  17. }